#!/bin/bash

iface=eth0
bcast=$(ifconfig $iface | grep Bcast | awk '{print $3}' | sed "s/Bcast://g")
network=$(echo $bcast | cut -d. -f1-3)
MAC_GSW=00:23:7d:ed:9b:88
MAC_NAT=00:24:81:80:31:54

case "$network" in
	168.18.223) wakeonlan -i $bcast $MAC_GSW ;;
	192.168.1)  wakeonlan -i $bcast $MAC_NAT ;;
	*)          echo "Unrecognized network: $network.0/24";;
esac	


